<template>
  <div class="app-container">
    <div class="filter-container">
      <el-form :inline="true" :model="formModel" >
        <el-form-item class="no-warn-item" label=" 任务编号:" prop="pcsgId">
          <el-input
            v-model="formModel.pcsgId"
            placeholder="任务编号"
            class="filter-item "
            clearable
          />
        </el-form-item>
        <el-form-item class="no-warn-item" label="任务代码:" prop="pcsgCd">
          <el-select v-model="formModel.pcsgCd" filterable clearable>
            <el-option v-for="item in pcsgCdArr" :key="item.pcsgCd" :label="item.pcsgDescribe" :value="item.pcsgCd"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item class="no-warn-item" label="任务状态:" prop="pcsgState">
          <hey-select v-model="formModel.pcsgState" clcd="pcsg_state_cd" />
        </el-form-item>
        <el-row class="submit-area">
          <el-col :span="24">
            <el-button type="primary" v-if="hasPermission('task_select')" plain @click="queryList(false)">查询</el-button>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <hey-table ref="table" :columns="columns" :auto-width="false">

    </hey-table>
  </div>
</template>

<script>
  export default {
    name: 'TaskList',
    data() {
      return {
        pcsgCdArr: [],
        formModel: {
          pcsgId: '',
          pcsgCd: '',
          pcsgState: '',
        },
        columns: [
          { title: '任务编号', key: 'pcsgId'},
          { title: '任务代码', key: 'pcsgCd'},
          { title: '任务描述', key: 'pcsgDescribe'},
          { title: '任务状态', key: 'pcsgState',clcd: 'pcsg_state_cd'},
          { title: '错误信息', key: 'pcsgErrMsg' },
          { title: '任务起始时间', key: 'pcsgStTime'},
          { title: '任务结束时间', key: 'pcsgEndTime'},
        ]
      }
    },
    computed: {},
    mounted() {
      const url = '/task/querypcsgConfigTbl'
      const param = {}
      this.post(url, param).then(res => {
        this.pcsgCdArr = res
      })
    },
    methods: {
      queryList() {
        this.$refs.table.query('/task/queryPcsgQueueTbl', this.formModel, '', false)
      },
    }
  }
</script>


